//
//  BBMyReleaseJobCell.m
//  BearSiX
//
//  Created by BearBaby on 16/3/29.
//  Copyright © 2016年 Tom. All rights reserved.
//

#import "BBMyReleaseJobCell.h"

@implementation BBMyReleaseJobCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        NSArray* array = @[@"3.png",@"4.png"];
        //头像
        self.headImage = [[UIImageView alloc]initWithFrame:CGRectMake(15, 15, 50, 50)];
        self.headImage.layer.cornerRadius = 25;
        self.headImage.layer.masksToBounds = YES;
        self.headImage.image = [UIImage imageNamed:@"2.png"];
        [self addSubview:self.headImage];
        //姓名
        self.nameLabel = [[UILabel alloc]init];
        self.nameLabel.text = @"张蕊";
        self.nameLabel.textColor = [UIColor colorWithHexString:@"e1464d"];
        self.nameLabel.font = [UIFont systemFontOfSize:WINSIZEWIDTH/25];
        CGSize nameSize = [self.nameLabel.text sizeWithFont:self.nameLabel.font constrainedToSize:CGSizeMake(300, 300) lineBreakMode:NSLineBreakByWordWrapping];
        self.nameLabel.frame = CGRectMake(CGRectGetMaxX(self.headImage.frame)+10, 20, nameSize.width, nameSize.height);
        [self addSubview:self.nameLabel];
        //时间
        self.timeLabel = [[UILabel alloc]init];
        self.timeLabel.text = @"2015-12-20 10:00";
        self.timeLabel.textColor = [UIColor colorWithHexString:@"a5a5a5"];
        self.timeLabel.font = [UIFont systemFontOfSize:WINSIZEWIDTH/27];
        CGSize timeSize = [self.timeLabel.text sizeWithFont:self.timeLabel.font constrainedToSize:CGSizeMake(300, 300) lineBreakMode:NSLineBreakByWordWrapping];
        self.timeLabel.frame = CGRectMake(CGRectGetMaxX(self.headImage.frame)+10, CGRectGetMaxY(self.headImage.frame) - 5-timeSize.height, timeSize.width, timeSize.height);
        [self addSubview:self.timeLabel];
        
        //督办
        self.urgeLabel = [[UILabel alloc]init];
        self.urgeLabel.text = @"督办";
        self.urgeLabel.font = [UIFont systemFontOfSize:WINSIZEWIDTH/25];
        self.urgeLabel.textColor = [UIColor colorWithHexString:@"e1464d"];
        CGSize urgeSize = [self.urgeLabel.text sizeWithFont:self.urgeLabel.font constrainedToSize:CGSizeMake(300, 300) lineBreakMode:NSLineBreakByCharWrapping];
        self.urgeLabel.frame = CGRectMake(WINSIZEWIDTH - 15 - urgeSize.width, 20, urgeSize.width, urgeSize.height);
        [self addSubview:self.urgeLabel];
        //进度条
//        self.progress = [[KACircleProgressView alloc] initWithFrame:CGRectMake(WINSIZEWIDTH - 55, self.headImage.frame.origin.x, 40, 40)];
//        self.progress.trackColor = [UIColor lightGrayColor];
//        self.progress.progressColor = [UIColor colorWithRed:227/255.0 green:71/255.0 blue:76/255.0 alpha:1];
//        self.progress.progress = 0.78;
//        self.progress.progressWidth = 2;
//        [self addSubview:self.progress];
        
        //百分比
//        self.percentLabel = [[UILabel alloc]init];
//        self.percentLabel.text = @"78%";
//        self.percentLabel.font = [UIFont systemFontOfSize:WINSIZEWIDTH/27];
//        
//        self.percentLabel.textColor = [UIColor colorWithRed:227/255.0 green:71/255.0 blue:76/255.0 alpha:1];
//        self.percentLabel.textAlignment = NSTextAlignmentCenter;
//        CGSize perSize = [self.percentLabel.text sizeWithFont:self.percentLabel.font constrainedToSize:CGSizeMake(300, 300) lineBreakMode:NSLineBreakByCharWrapping];
//        self.percentLabel.frame = CGRectMake(0, 20 - perSize.height/2, 40, perSize.height);
//        [self.progress addSubview:self.percentLabel];
        
        //内容
        self.contentLabel = [[UILabel alloc]init];
        self.contentLabel.text = @"婚纱集团(套系新增停用日期、新增套系全部删除权限、电子工作薄摄影拍照新增类别)。";
        self.contentLabel.numberOfLines = 0;
        self.contentLabel.font = [UIFont systemFontOfSize:WINSIZEWIDTH/22];
        CGSize contentSize = [self.contentLabel.text sizeWithFont:self.contentLabel.font constrainedToSize:CGSizeMake(WINSIZEWIDTH - 30, 300) lineBreakMode:NSLineBreakByWordWrapping];
        self.contentLabel.frame = CGRectMake(15, CGRectGetMaxY(self.headImage.frame)+10, contentSize.width, contentSize.height);
        [self addSubview:self.contentLabel];
        //图片
        for (int i = 0; i<array.count; i++) {
            self.imageV = [[UIImageView alloc]initWithFrame:CGRectMake(15+((WINSIZEWIDTH - 40)/3+5)*i, CGRectGetMaxY(self.contentLabel.frame)+10, (WINSIZEWIDTH - 40)/3, (WINSIZEWIDTH - 40)/3)];
            self.imageV.image = [UIImage imageNamed:[NSString stringWithFormat:@"%@",array[i]]];
            [self addSubview:self.imageV];
        }
        
        _finalH = CGRectGetMaxY(self.imageV.frame)+10;
        
    }
    
    
    return self;
}

@end
